package com.jt.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProviderController {

    @Value("${server.port:8080}")
    private String server;
    //访问方式：
    //1.浏览器中直接输入http://localhost:8081/provider/echo/tedu
    //2.在sca-consumer中对这个服务进行访问

    @GetMapping("/provider/echo/{msg}")
                            //兼容之前的版本号@PathVariable("msg")
    public String doRestEcho1(@PathVariable String msg){
        return server + " say hello " + msg;
    }
}
